package com.example.order.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.example.service.IUseService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: songyahui
 * @Date: 2020/10/31 20:34
 * @Version 1.0
 */
@RestController
@RequestMapping("/user")
public class UserController {
//  注意注解的包是 com.alibaba.dubbo.config.annotation，也可以引入参数'ip:port'直连
    @Reference(stub = "com.example.order.service.UseStub")
    private IUseService useService;


    @RequestMapping("/sayHello/{name}")
    public String sayHello(@PathVariable(name = "name") String name){
        return useService.sayHello(name);
    }
}
